Skip to content

implement a strip_pre configuration option (#218) #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

chrispy-snps
Copy link
Collaborator

@chrispy-snps chrispy-snps commented May 27, 2025

Fixes #218.

Implements a new strip_pre configuration option that provides control over how (and if) leading/trailing blank lines are stripped from <pre> tags.

The default is STRIP to strip all leading/trailing blank lines, which represents a change in behavior. (Previous releases did not perform any blank-line removal in <pre> tags.)

Signed-off-by: chrispy <chrispy@synopsys.com>
@chrispy-snps chrispy-snps requested a review from AlexVonB May 27, 2025 23:25
@chrispy-snps
Copy link
Collaborator Author

chrispy-snps commented May 27, 2025

@AlexVonB, what are your thoughts on the following:

  • Do you have a preference for the for the single-line value (STRIP_ONE, STRIP1, STRIP_1, etc.)?
  • Are you agreeable to a default value of STRIP (remove all leading/trailing blank lines)?
    • This would be a change in behavior, but a good one I think. @stevecj also mentioned something about this here.

Copy link
Collaborator

@AlexVonB AlexVonB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I personally feel that the number 1 looks off, so I am in favor for ONE (as well in the code). The default could also be STRIP_ONE, like described in MDN: they ignore only the first newline. But both ist fine with me!

@chrispy-snps
Copy link
Collaborator Author

@AlexVonB - I was thinking of default to STRIP (all) because HTML is often formatted badly, and part of the purpose of Markdown is to be human-friendly and readable.

@matthewwithanm - want to be a tie-breaking vote? :)

@AlexVonB
Copy link
Collaborator

Sorry for the late response: let's go with your proposal!

Signed-off-by: chrispy <chrispy@synopsys.com>
@chrispy-snps chrispy-snps force-pushed the chrispy/strip-blank-lines-from-pre branch from 23952e7 to fedf535 Compare June 14, 2025 20:36
@chrispy-snps chrispy-snps merged commit 9b1412a into matthewwithanm:develop Jun 14, 2025
1 check passed
@chrispy-snps
Copy link
Collaborator Author

Thanks @AlexVonB - it's merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should not treat newline at end of pre/code block as blank line
2 participants